<?php
/*
 * @Author: your name
 * @Date: 2020-05-06 21:58:38
 * @LastEditTime: 2020-05-27 11:24:13
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /v3/application/adminapiv3/controller/permissionsManage/PermissionsController.php
 */
namespace app\adminapiv3\controller\permissionsManage;
 
use app\adminapiv3\controller\Base;
use app\adminapiv3\service\permissionsManage\PermissionsService;
use think\facade\Request;

class PermissionsController extends Base
{
    /**
     * @name: 用户组权限列表
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2020-05-11 11:17:03
     */
    public function groupPermissionsList ($user_group_id)
    {
        $PermissionsService = new PermissionsService();
        $data = $PermissionsService->groupPermissionsList($user_group_id);

        $this->jsonOutPut($data);
    }





    /**
     * @name: 修改用户组权限
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2020-05-26 13:59:32
     */
    public function modifyUserGroupPermissions ($user_group_id)
    {

        global $logContent;
        $logContent = '修改用户组权限';

        $permissions = input('permissions/a');

        $PermissionsService = new PermissionsService();
        $PermissionsService->modifyUserGroupPermissions($user_group_id, $permissions);

        $this->jsonOutPut();

    }

    /**
     * @name 用户权限列表
     * @author wx
     * @date 2020/12/22 17:36
     */
    public function userPermissionsList($user_id)
    {
        $PermissionsService = new PermissionsService();
        $data = $PermissionsService->userPermissionsList($user_id);

        $this->jsonOutPut($data);
    }

    /**
     * @name 修改用户权限
     * @author wx
     * @date 2020/12/22 17:37
     */
    public function userPermissionsModify($user_id)
    {
        global $logContent;
        $logContent = '修改用户权限';

        $permissions = input('permissions/a');

        $PermissionsService = new PermissionsService();
        $PermissionsService->modifyUserPermissions($user_id, $permissions);

        $this->jsonOutPut();
    }
}

